/**
 * There are <a href="https://www.hdzhx.com">邯郸智讯</a> code generation
 */
package com.boxin.ims.modules.jiujiudevice.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.phoenix.common.lang.MathUtil;
import com.thinkgem.jeesite.common.persistence.BaseEntity;

/**
 * 押金记录Entity
 * @author sxh
 * @version 2018-08-15
 */
@Entity
@Table(name = "jiu_cash_record")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class JiuCashRecord extends BaseEntity {
	
	/**
	 *  未支付
	 */
	public final static Integer STATUS_NO_PAY = 0;
	
	/**
	 * 已支付
	 */
	public final static Integer STATUS_YES_PAY = 1;
	
	/**
	 * 已退款
	 */
	public static final Integer STATUS_REFUND = 2;
	/**
	 * 支付失败
	 */
	public static final Integer PAY_STATUS_FAIL = 0;
	/**
	 * 支付成功
	 */
	public static final Integer PAY_STATUS_SUCCESS = 1;
	
	private static final long serialVersionUID = 1L;
	
	private Long id; 		// 编号
	/**
	 * 押金订单号
	 */
	private String orderNo;
	/**
	 * 微信支付业务号
	 */
	private String transactionId;
	private Long memberId;//会员id
	private String memberName;//会员名字
	private String memberNickname;//会员昵称
	private String memberMobile;//会员手机号
	private String memberOpenId;//微信标识
	private Double money;//金额
	/**押金状态 0-未支付 ，1-支付，2-退款*/
	private Integer status;
	
	/**支付状态 0-失败，1-成功*/
	private Integer payStatus;
	/**错误码*/
	private String errorCode;
	/**错误消息*/
	private String errorMsg;
	
	
	/**退款状态*/
	private Integer refundStatus;
	/**退款时间*/
	private Date refundTime;
	/**退款错误码*/
	private String refundErrorCode;
	/**退款错误消息*/
	private String refundErrorMsg;
	/**支付时间*/
	private Date payTime;
	
	private Date createTime;	// 创建日期
	
	public String getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}

	public String getTransactionId() {
		return transactionId;
	}

	public void setTransactionId(String transactionId) {
		this.transactionId = transactionId;
	}

	public JiuCashRecord() {
		this.createTime = new Date();
	}

	public JiuCashRecord(Long id){
		this();
		this.id = id;
	}
	
	public Long getMemberId() {
		return memberId;
	}

	public void setMemberId(Long memberId) {
		this.memberId = memberId;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}


	public String getMemberName() {
		return memberName;
	}

	public void setMemberName(String memberName) {
		this.memberName = memberName;
	}

	public String getMemberNickname() {
		return memberNickname;
	}

	public void setMemberNickname(String memberNickname) {
		this.memberNickname = memberNickname;
	}

	public String getMemberMobile() {
		return memberMobile;
	}

	public void setMemberMobile(String memberMobile) {
		this.memberMobile = memberMobile;
	}

	public String getMemberOpenId() {
		return memberOpenId;
	}

	public void setMemberOpenId(String memberOpenId) {
		this.memberOpenId = memberOpenId;
	}

	public Double getMoney() {
		return money;
	}

	public void setMoney(Double money) {
		this.money = money;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Integer getRefundStatus() {
		return refundStatus;
	}

	public void setRefundStatus(Integer refundStatus) {
		this.refundStatus = refundStatus;
	}

	public Date getRefundTime() {
		return refundTime;
	}

	public void setRefundTime(Date refundTime) {
		this.refundTime = refundTime;
	}

	public String getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}

	public String getErrorMsg() {
		return errorMsg;
	}

	public void setErrorMsg(String errorMsg) {
		this.errorMsg = errorMsg;
	}

	public Date getPayTime() {
		return payTime;
	}

	public void setPayTime(Date payTime) {
		this.payTime = payTime;
	}

	public Integer getPayStatus() {
		return payStatus;
	}

	public void setPayStatus(Integer payStatus) {
		this.payStatus = payStatus;
	}

	public String getRefundErrorCode() {
		return refundErrorCode;
	}

	public void setRefundErrorCode(String refundErrorCode) {
		this.refundErrorCode = refundErrorCode;
	}

	public String getRefundErrorMsg() {
		return refundErrorMsg;
	}

	public void setRefundErrorMsg(String refundErrorMsg) {
		this.refundErrorMsg = refundErrorMsg;
	}

	@NotNull
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public static String generateOrderNo() {
		return "NO"+((int)((Math.random()*9+1)*10000))+System.currentTimeMillis();
	}
	
}


